#ifndef DYNALABEL_H
#define DYNALABEL_H

#include <QtGui>
#include <QDebug>

#include <watertile.h>

class DynaLabel : public QLabel
{
    Q_OBJECT
    int id;
    QString type;
    QString typeShip;

public:
    explicit DynaLabel(QWidget *parent, int newId): QLabel(parent), id(newId) {
        setMouseTracking(true); // enable mouse move events
    }
    void mouseMoveEvent(QMouseEvent *ev) {
        // mouse was moved over me; move away!
        //int amount = random() % 50 - 25;
        //move(x() + amount, y() + amount);
    }

    void mousePressEvent(QMouseEvent *ev);
//    void enterEvent(QMouseEvent *ev);
//    void leaveEvent(QMouseEvent *ev);

    void mouseReleaseEvent(QMouseEvent *ev) {

        return;
    }
    int getId() { return id; }
    QString getType() { return type; }
    QString getTypeShip() { return typeShip; }

    void setType(QString newType) { type = newType; }
    void setTypeShip(QString newTypeShip) { typeShip = newTypeShip; }

    //signal the mainwindow to redraw the grid
signals:
    void tileClicked();
    void shipClicked();


};

#endif // DYNALABEL_H
